<script lang="ts" setup>
import { ref, reactive } from "vue";

const open = ref(false);
const form = reactive({});

const props = defineProps<{
  title: string;
  editFormMap: any[];
  editAble: boolean;
}>();

const emit = defineEmits(["ok"]);
</script>

<template>
  <a-modal
    centered
    destroyOnClose
    v-model:visible="open"
    :title="props.title"
    @ok="emit('ok')"
    :okText="editAble ? '提交' : '关闭'"
  >
    <ProFrom
      ref="editFormRef"
      :mapping="editFormMap"
      :model-value="form"
      :readonly="!editAble"
    >
    </ProFrom>
  </a-modal>
</template>

<style lang="less" scoped></style>
